package com.xinqi.modules.course.course.enums.group;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.annotations.Describe;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * @author wenjie-cc
 */
@Describe("分组创建方式")
public enum GroupCreatedTypeEnum implements BaseEnum {

    /**
     * 学生自由分组
     */
    FREEDOM("FREEDOM", "学生自由分组"),


    /**
     * 老师指定分组
     */
    SPECIFIED("SPECIFIED", "老师指定分组"),


    /**
     * 系统随机分组
     */
    RANDOM("RANDOM", "系统随机分组");

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    GroupCreatedTypeEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static GroupCreatedTypeEnum of(String code) {
        return BaseEnum.of(GroupCreatedTypeEnum.class, code);
    }

}
